/**

Title   : Joystick.cpp
Author  : Manikantan Nambi
URL :

Description : Function headers for Joystick.h.
Created : 1/1/11
Modified   : 2/14/11

*/


#ifndef JOYSTICK_H
#define JOYSTICK_H

#include <qmetatype.h>
#include <qtextstream.h>
#include <QtCore>
//#include <QtGui>
#include <QWidget>

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <X11/Xlib.h>
#include <spnav.h>
#include <math.h>


using namespace std;

/** \brief Class for Space Explorer. Stores x, y, z and Rx, Ry, and Rz inputs for the Space Explorer */
class Joystick:public QWidget {
    Q_OBJECT

public:
    Joystick(QWidget *parent = 0);
    ~Joystick();

    int x;
    int y;
    int z;
    int rx;
    int ry;
    int rz;

    int button;

    /** Spnav event type */
    spnav_event dEvent;

    int open();
    void close();


public slots:
    void pollDevice();
    double velMag();
    double velDir();

signals:

protected:

private:


};






#endif // SPACEEXPWIDGET_H
